<template>
  <div class="dialog-container">
    <el-dialog :visible.sync="showAdd" width="60%" top="1%" :title="titles[btnType]" :before-close="handleClose">
      <el-form ref="form" :model="form">
        <div class="modal-content">
          <table class="table-container">
            <tbody>
              <tr>
                <td class="td-label-2">
                  <must />行政区划代码
                </td>
                <td>
                  <el-input v-model="form.adCd" v-validate="'required|max:6'" name="行政区划代码" placeholder="请输入行政区划代码">
                  </el-input>
                  <span v-show="errors.has('行政区划代码')" style="color: red;">{{ errors.first('行政区划代码') }}</span>
                </td>
                <td class="td-label-2">行政区划简称</td>
                <td>
                  <el-input v-model="form.adShnm" v-validate="'max:50'" name="行政区划简称" placeholder="请输入行政区划简称">
                  </el-input>
                </td>
              </tr>
              <tr>
                <td class="td-label-2">
                  <must />行政区划名称
                </td>
                <td colspan="3">
                  <el-input v-model="form.adNm" v-validate="'required|max:100'" name="行政区划名称" placeholder="请输入行政区划名称">
                  </el-input>
                  <span v-show="errors.has('行政区划名称')" style="color: red;">{{ errors.first('行政区划名称') }}</span>
                </td>
              </tr>
              <tr>
                <td class="td-label-2">
                  <must />层级
                </td>
                <td>
                  <el-input v-model="form.level" v-validate="'required'" name="层级" placeholder="请输入层级"></el-input>
                  <span v-show="errors.has('层级')" style="color: red;">{{ errors.first('层级') }}</span>
                </td>
                <td class="td-label-2">
                  <must />状态
                </td>
                <td>
                  <el-radio-group v-model="form.status" name="状态" v-validate="'required'">
                    <el-radio-button v-for="(val, key) in allDictData.statusOps" :label="key" :key="key">{{val}}
                    </el-radio-button>
                  </el-radio-group>
                </td>
              </tr>

            </tbody>
          </table>
        </div>
      </el-form>
      <div slot="footer">
        <el-button @click="handleClose" type="danger">关 闭</el-button>
        <el-button @click="handleSave" type="primary" :disabled="btnDisabled">保 存</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  /* mixins */
  import addUpdateMixin from '@/mixins/addUpdate/addUpdateMixin.js'
  import uploadImgMixin from '@/mixins/addUpdate/uploadImgMixin.js'

  export default {
    /*  内容: addr_addUpdate */
    name: 'addr_addUpdate',
    data() {
      return {
        form: {
          adCd: '',
          adNm: '',
          adShnm: '',
          level: '',
          status: '1',
        },
      }
    },
    mixins: [addUpdateMixin, uploadImgMixin],
    props: ['allDictData'],
    methods: {

    } // methods end
  }
</script>
<style scoped>
  @import "~@/styles/form.css";
</style>
